import { Request, Response, NextFunction } from 'express';
import { ResponseWrapper } from '../../framework/utils/ResponseWrapper';
import { catchAsync } from '../../framework/utils/catchAsync';


import { NewsService } from "../services/news.service";

export class NewsController {
  private newsService: NewsService;

  constructor() {
    this.newsService = new NewsService();
  }

  /**
   * 获取热搜数据
   */
  getNews = catchAsync(async (req: Request, res: Response, next: NextFunction) => {
    const news = await this.newsService.getNews(req.params.id);
    ResponseWrapper.success(res, news, '热搜数据获取成功');
  });



}